#pragma once

#include "Box2d/Dynamics/b2WorldCallbacks.h"

#include "Subject.h"

namespace ZeEngine
{
    class Entity;

    class B2ContactListener : public b2ContactListener, public Subject
    {
    public:
        B2ContactListener();
        virtual ~B2ContactListener();

        //b2ContactListener

        // Called when two fixtures begin to touch
        virtual void BeginContact(b2Contact* contact);
  
        // Called when two fixtures cease to touch
        virtual void EndContact(b2Contact* contact);

        const Entity& GetEntity1() const;
        const Entity& GetEntity2() const;
        bool IsStartContact() const;
        bool IsEndContact() const;

    private:
        Entity* m_pEntity1;
        Entity* m_pEntity2;
        bool    m_fStartContact;
    };
}

